<template>
	<div>


	<div class="login-content">

     <h3 style="font-weight: normal;">详细信息</h3>
	   <van-steps :active="active" style="margin-bottom: 12px;">
			  <van-step>选择地区</van-step>
			  <van-step>选择机构</van-step>
			  <van-step>选择名称</van-step>
			  <van-step>详细信息</van-step>
	   </van-steps>
	  <div class="btn_content">
		 <textarea v-model="message" placeholder="例：xx系xx专业xx班级xx学号"></textarea>

      </div>
	</div>
  <div class="btn_submit" >
  	   <van-button type="primary" @click="goback()" size="large" style="background-color: #CCCCCC;color: #fff;border:none">上一步</van-button>
  	   <van-button type="primary" @click="done()" size="large" style="background-color: #4C9FFD;border:none">完成</van-button>
  </div>
  </div>

</template>
<script>
	export default{
		data(){
			return{
				  active:3,
				  item:'',
				  message:'',
          cityId:'',
          enterpriseValue:'',
          enterId:''

			}
		},
      mounted:function(){
          this.cityId = this.$route.query.cityId;
          this.enterpriseValue = this.$route.query.enterpriseValue;
          this.enterId = this.$route.query.enterId;
          console.log(this.cityId);
          console.log(this.enterpriseValue);
          console.log(this.enterId);

      },
		methods:{
        //上一步
        goback(){
            this.$router.push({
                path:'/selectname',
                query:{cityId:this.cityId,enterpriseValue:this.enterpriseValue}
            })
        },

        //下一步
        done(){
            const that = this;
            let user = JSON.parse(localStorage.getItem('user'));
            console.log(user);
            let p = "userId="+user.userId+"&cityId="+that.cityId+"&enterpriseValue="+that.enterpriseValue+"&enterId="+that.enterId+"&remarks="+that.message;
            console.log(p);
            that.$sendRequest('/login/informationInfo',p).then(function(res){
                console.log(res);
                if(res.data.code ==0){
                    localStorage.setItem('user', JSON.stringify(res.data.result.user));
                    that.$router.push({
                        path: '/banner'
                    })
                }
            })
        }

		}
	}
</script>

<style scoped="scoped">

	.login-content{
		padding: 12px;
	}

	.btn_content{
		text-align: left;


	}
	.btn_content textarea{
		    width: 99%;
		    border:1px solid #4C9FFD;
    		height: 20vh;
	}
	.btn_content button{
		width: 43%;
		margin-left: 15px;
		margin-bottom: 17px;
		border:1px solid #4C9FFD;
		color: #4C9FFD;
	}
	.btn_submit{
		display: flex;
		justify-content: space-around;
		position: absolute;
		bottom: 0;
		width: 100%;
	}

</style>
